package com.iyoudoock.citymine.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.iyoudoock.citymine.R;
import com.iyoudoock.citymine.constants.HttpUtils;
import com.iyoudoock.citymine.constants.Key;
import com.iyoudoock.citymine.constants.Value;
import com.kvin.toolkit.utils.ToastUtils;
import com.kvin.toolkit.utils.http.JsonHttpResponseHandler;
import com.kvin.toolkit.utils.http.JsonUtils;

import org.json.JSONObject;

import java.io.IOException;

/**
 * A simple {@link Fragment} subclass.
 */
public class OrderProgressingFragment extends BaseFragment {


    public OrderProgressingFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_order_progressing, container, false);
    }


    @Override
    public void init() {
        mJsonUtils= JsonUtils.newInstance();
        String roleType=mPersistentUtils.readString(Key.User.ROLE_TYPE);
        mParams= HttpUtils.myOrder(mUid,roleType, Value.Tab.PROCESSING,String.valueOf(1));

        mJsonUtils.post(HttpUtils.MY_ORDER_URL,mParams,new JsonHttpResponseHandler(){
            @Override
            public void onSuccess(JSONObject response) {
                super.onSuccess(response);
                ToastUtils.simpleToast(getActivity(),"暂无订单信息");
            }

            @Override
            public void onFailure(IOException e) {
                super.onFailure(e);
            }
        });

    }
}
